<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>


<style type="text/css">
<!--
    #divCalendar { display:none; position:absolute; left:10px; top:300px; z-index:1 }
    #cal1Container {
        position: absolute;
        display: none;
    }
    p, #cal1Container {
        margin: 1em;
    }
    #cal1Container {
        z-index: 500;
    }
-->
</style>


<script type="text/javascript">

YAHOO.util.Event.onDOMReady(function(){

	var generateReserveInfo = function() {
        isdnSendRequest("reserveInfoType_generateReserveInfoJSON.action", '' , "POST", callbackGenerateReserveInfo);
    };

    callbackGenerateReserveInfo = function() {
        var ready = req.readyState;
        //  console.debug(ready);
        var jsonObject=null;
        if ( ready == 4 ){
            if(req.status == 200) {
                jsonObject=eval( "("+ req.responseText +")" );
  
                if(jsonObject.object.data){
                    var detail  = jsonObject.object.data['com.appsindy.reserv.vo.ReserveInfoVO'];
                    var size    = 0;
                    var colList;
                    if(detail && detail.length){
                        size    = detail.length;
                        for(var i = 0; i < size; i ++) {
                        	colList						= new Array();
                            colList["dateFrom"]			= detail[i].dateFrom;
                            colList["dateTo"]			= detail[i].dateTo;
                            colList["typeOfRoomId"]		= detail[i].typeOfRoomId;
                            colList["typeOfRoom"]		= detail[i].typeOfRoom;
                            colList["zone"]				= detail[i].zone;
                            colList["floor"]			= detail[i].floor;
                            colList["day"]				= detail[i].day;
                            colList["qtyRoomPerDay"]	= detail[i].qtyRoomPerDay;
                            colList["ratePerRoom"]		= detail[i].ratePerRoom;
                            colList["totalAmount"]		= detail[i].totalAmount;
                            colList["breakfast"]		= detail[i].breakfast;                           
                            colList["errCode"]			= detail[i].errCode;                           
                            colList["errMsg"]			= detail[i].errMsg;                           
                            
                            addRowReserve(colList); 
                        }
                    }else{
                    	colList						= new Array();
                        colList["dateFrom"]			= detail.dateFrom;
                        colList["dateTo"]			= detail.dateTo;
                        colList["typeOfRoomId"]		= detail.typeOfRoomId;
                        colList["typeOfRoom"]		= detail.typeOfRoom;
                        colList["zone"]				= detail.zone;
                        colList["floor"]			= detail.floor;
                        colList["day"]				= detail.day;
                        colList["qtyRoomPerDay"]	= detail.qtyRoomPerDay;
                        colList["ratePerRoom"]		= detail.ratePerRoom;
                        colList["totalAmount"]		= detail.totalAmount;
                        colList["breakfast"]		= detail.breakfast;                           
                        colList["errCode"]			= detail.errCode;                           
                        colList["errMsg"]			= detail.errMsg;                           
                        
                        addRowReserve(colList); 
                    }
                    calculateTotalAmount();
                }
            }
        }
    };
    
    //Event.addListener(window, 'load', init);
    generateReserveInfo();

});
</script>